<?php
    session_start();
    include_once "fbmain.php"; //Controla la conexion a API Facebook
    include_once "bdmain.php"; //Conexion a BD
    //include_once "fql.php";    //Obtiene Datos a traves de fql
    
    //set page to include default is home.php
    //$page   =   isset($_REQUEST['page']) ? $_REQUEST['page'] : "home.php";

    
    //echo 'Hola index 2: '.$user;
    //echo $_SESSION['fan'];
    
    if($_SESSION['fan'] == '1')
    {
        //echo 'SI ES FAN';
        include_once "template.php";
    }
    else
    {
        //echo 'NO ES FAN';
        header("Location: " . $fbconfig['fanpageAppBaseUrl']);
        exit;
    }
    
?>